The online racing simulator
Searching in All forums
(951 results)
Yisc[NL]
S3 licensed
Could it be that timer starts when you spawn to your start position and ends when you cross a checkpoint, where the extra 2 seconds are about the time it takes before the line goes green?
If I remember well, the starting lights have slightly different timeframe in which it operates.
Yisc[NL]
S3 licensed
Actually, it is possible and I even made a live script at some point Face -> palm (as a test for something bigger I had planned to build at some point, but that never happened in the end).
Find attached script, which does display live information about another player.

Save the file in your Includes folder and rename it to: following.lpr
Also add a line to addonsused.lpr to be able to use this script.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
LFSRelax must handle the gapping information differently then Lapper does.
Maybe their way can be build with Lapper as well, but I am not sure that it can be done with "live" information.
When I am having doubt about something being possible or not, I usually create a very basic script with output to Lapper console or LFS chat to see if it's possible.
You only need a few players to test such thing.
Yisc[NL]
S3 licensed
I think you can use the NodeAction as you suggested, but you also need to consider this:

Event OnNewGapPlayerBehind() // When a new gap are avaiable for player behind you
Event OnNewGapPlayerBefore() // When a new gap are avaiable for player before you

Gaps (Behind and Before) are only updated when a player crosses a sector- or finishline and then those events are triggered.

I don't know exactly what you are trying to achieve.
Feel free to share your idea (and if possible your Lapper script as well) here with me.
Otherwise send me a Private Message on this forum or you could send me the script through email if you wish.
Yisc[NL]
S3 licensed
Would this work:

$Behind_NickName = GetPlayerVar( GetCurrentPlayerVar("UNameBehind"), NickName) );
Yisc[NL]
S3 licensed
I've looked into the code and think this should do what you want:

$Behind_NickName = GetPlayerVar( getplayerinfo("UNameBehind"), NickName) );
Yisc[NL]
S3 licensed
UNameBehind = is the UserName

I cannot remember what information is returned when using: getplayerinfo("UNameBehind")
But if you know the UserName, it wouldn't be too hard to get the nickname from that.
Yisc[NL]
S3 licensed
Ah okay, yes the default only shows Top25 of each car.
That's the reason I made my own scripts, like the one I already mentioned, but you might also want to check this one out: https://www.lfs.net/forum/post/1883528#post1883528

Look for: toptable.txt
Yisc[NL]
S3 licensed
Quote from Andy King :Hi Yisc, how do I increase the number of records shown?

Andy

As far as I remember, this is no limit to the number of records shown.
If I look at the image below, I see that a "Next page" button is shown, if there are more records then to fit on one page.

Yisc[NL]
S3 licensed
You might want to have a look at this script: https://www.lfs.net/forum/post/1930000#post1930000

I made it to be able to delete records, but before that, records are displayed on screen.
Yisc[NL]
S3 licensed
Very nice that video
Yisc[NL]
S3 licensed
Quote from Andy King :Hi Dan, cheers for this. I have tried for ages to get the info I need AS3+FXR AS3+FZR AS3+XRR but all I get is "No LFS World PB for this criteria" and PubStat is set.

Andy

I looked into this and got it "working" with the following script:


CatchEvent OnNewPlayerJoin( $userName ) # Player event
OnNewPlayerJoin__LFSW_pb_chk();
EndCatchEvent

Sub OnNewPlayerJoin__LFSW_pb_chk() # Player event
$argv=getLapperVar( "ShortTrackName" ) . " XFG";
writeline ( "DEBUG: " . CurrentPlayerlfsWorldPB( $argv ) );
EndSub

First I had it in the OnConnect Event, but then it's failing all the time.
In the OnNewPlayerJoin the code is working BUT instead of returning a value (or values) it opens a list on screen (which cannot be closed).
That list is displaying the information that has been asked for "BL1 XFG" (in my case), but you cannot use it to check anything, because all of this is hardcoded into Lapper, like Bass-Driver already said.
So for now, this function isn't very usefull, but maybe this will inspire Bass-Driver to change it in a future Lapper version.

Yisc[NL]
S3 licensed
I would like to write the script for you, but currently it's not possible to use Lapper to get a PBLapTime for LFSW.
I could make a script checking the PB from your local database, but that would mean that people first need to get an opportunity to set a descent lap time.
Or Bass-Driver should try to add the option of retrieving a PBLapTime from LFSW using Lapper.
Yisc[NL]
S3 licensed
Again the answer could have been found in 'changes.txt' where it says this:

+----------------------------------------+
|Changes from v5.902 to 5.903 |
+----------------------------------------+

Add player var retreiveid from Pubstat

PSDistance, // online statistics of one racer - distance in metres
PSFuel, // online statistics of one racer - fuel burnt in cl
PSLaps, // online statistics of one racer - laps
PSHostsJoined, // online statistics of one racer - hosts joined
PSWins, // online statistics of one racer - Wins
PSSecond, // online statistics of one racer - Second
PSThird, // online statistics of one racer - third
PSFinished, // online statistics of one racer - finished
PSQuals, // online statistics of one racer - quals
PSPole, // online statistics of one racer - pole
PSDrags, // online statistics of one racer - drags
PSDragWins, // online statistics of one racer - drag wins
PSCountry, // online statistics of one racer - country

The error means that the syntaxt of one of those buttons is incorrect.
I cannot look into that at the moment, but should be easy to figure out when looking at the line number given in the error log.

It's not possible to retrieve the LFSW PB laptime for a player.
You can make authorisation rules using this event:

###################################
#Authorization Options ( license )#
###################################

As a side note.
Value $DefaultTopCar can be changed using: SetConfigVar("DefaultTopCar", "FXR");
See the following script how this can be used: https://www.lfs.net/forum/thread/91566-Deleter-records-%28laptimes---driftscores%29
Yisc[NL]
S3 licensed
I have tested this and it's working:

Sub BanPanel_Ban ( $id, $Days )

$id = the name of the button that was clicked to get to this sub
$Days = the number of days you want to ban a player

So if you would strip "BAN_" out of the $id, you have the $uUCID remaining and that should then you have the two needed arguments to execute the ban.
Yisc[NL]
S3 licensed
Quote from Andy King :Hi Dan, "hostnamestripped" would be very useful when running more than 1 server

Andy

There is already an option called: StripLFSColor
I cannot see a reason why that wouldn't work on the hostname, like this:

$var = StripLFSColor( GetLapperVar("hostname") );
Yisc[NL]
S3 licensed
Problem 1:

This button won't close on its own, so you have to close it using:
closePrivButton( "BAN_UI_Days" );

Problem 2:

I added a debug line (to be written to Lapper console) to see if $Days is filled when a value is entered into the button and that is happening.
This line isn't wrong, but doesn't make sense to me: $Cash = ToNum( ToString( $Days ) );
Why convert something to both Num and String?
I do get an error in this line: SetPlayerVar( GetPlayerVarByUCID( $Ucid , "UserName" ) , "Cash" , Round((ToNum( GetPlayerVarByUCID( $Ucid , "Cash" ) + $Cash )),2) );

The log-file is showing this error:

3/27/2019 8:09:13 PM -> Syntax error: in file ".\AB-configs\.\..\includes\.\test\test_ban.lpr" at line #35
'GetPlayerVarByUCID' parameter #0() is wrong type at line #
Function 'banpanel_ban' script aborted

Maybe this error happens because I am now running DCon and Lapper on my pc, but this could be the reason nothing is happening (as Lapper stops this script after that error).
Let me know if you have that error as well in your log-file.
Log-file can be found in: LFSLapper V7.0.6.3\bin\default\logs
Where the filename ends with ERR.txt


Sub BanPanel_Ban ( $KeyFlags, $Days )
writeline ( "DEBUG: " . $Days );
$Cash = ToNum( ToString( $Days ) );
$userName = GetCurrentPlayerVar("UserName");
SetPlayerVar( GetPlayerVarByUCID( $Ucid , "UserName" ) , "Cash" , Round((ToNum( GetPlayerVarByUCID( $Ucid , "Cash" ) + $Cash )),2) );
GlobalMsg( "Test $Days: ^6" . $Days );
PrivMsg( GetPlayerVarByUCID( $Ucid , "UserName" ), "Value: " . $Cash );
Cruise_HUD( $userName );
Cruise_HUD( GetPlayerVarByUCID( $Ucid , "UserName" ) );
ModPanel_Close ();
BanPanel_Close ();
EndSub

Yisc[NL]
S3 licensed
I have had a quick look, but cannot find where to activate the feature.
Maybe it's not longer active in Lapper, but the only person that can say something about that is Bass-Driver.
Yisc[NL]
S3 licensed
A little over 2 years ago I made a system to ban/unban players and check the bans (which do not expire until ban is manually lifted!) when someone connects.
Maybe it's useful to you are anyone else.
Save the file in your 'includes' folder and rename it to: ban_system.lpr
Add a line to 'addonsused.lpr' saying: include( "./ban_system.lpr");
Feel free to use it, work it over or not use it at all Wink
Yisc[NL]
S3 licensed
This information can be found in "changes.txt" which is located in folder 'doc'

+---------------------------------------+
|Changes from v5.824 to 5.825|
+---------------------------------------+

Add new command openPrivTextButton, to open a button who query an input string
openPrivTextButton( "ref2",103,140,20,10,10,32,"Caption","Toto",30,saisTxt );

Open a button for the current player, args are
1 - Unique id for this button
2 - Left coordinate for this button ( 0-200 )
$origL = (value between 0-200); - when this value is used, every next value can be made relative to this one ( example: $origL + 5; )
3 - Top coordinate for this button ( 0-200 )
$origT = (value between 0-200); - when this value is used, every next value can be made relative to this one ( example: $origT + 5; )
4 - Width of the button ( 0-200 )
5 - Heigth of the button ( 0-200 )
6 - Space between line in multiline button
7 - Format of the button, look at insim.txt for values
8 - Caption displayed in the input box
9 - Button Text
10 - Number char to be input
11 - Backcalled sub

+----------------------------------------+
|Changes from v5.919 to 5.920 |
+----------------------------------------+

openPrivTextButton now call the callBack subRoutine with 2 arg,
first = idOfButton
Second = Text

+----------------------------------------+
|Changes from v5.924 to 5.925 |
+----------------------------------------+

Add new command openTextButton, to open a button who query an input string for a specified player
openTextButton( "username","ref2",103,140,20,10,10,32,"Caption","Toto",30,saisTxt );

Open a button for the current player, args are
1 - UserName of the player who want open a text button
2 - Unique id for this button
3 - Left coordinate for this button ( 0-200 )
$origL = (value between 0-200); - when this value is used, every next value can be made relative to this one ( example: $origL + 5; )
4 - Top coordinate for this button ( 0-200 )
$origT = (value between 0-200); - when this value is used, every next value can be made relative to this one ( example: $origT + 5; )
5 - Width of the button ( 0-200 )
6 - Heigth of the button ( 0-200 )
7 - Space between line in multiline button
8 - Format of the button, look at insim.txt for values
9 - Caption displayed in the input box
10 - Button Text
11 - Number char to be input
12 - Backcalled sub

Backcalled function receive 2 args
first = idOfButton
Second = Text
Yisc[NL]
S3 licensed
Quote from Andy King :Hi Guys, this also doesn't work.....

$Posabs = GetCurrentPlayerVar("PosAbs");

Any Ideas has it changed?

Andy

If you want to know if something has changed or not, you can always consult the file 'changes.txt' which can be found in the "doc" folder.
You can also find all PlayerVars in file 'Player Vars.txt'

Var "PosAbs" is listed in there, so should be availabe.
Your syntax looks okay: GetCurrentPlayerVar( "PosAbs" )
So maybe the event where you have that code is never reached or there is a problem in that particular event, stopping Lapper before it reaches that line.
Such things can easily be checked by consulting the log-file that can be found in folder "bin\logs" and ends with ERR.log (like this: LFSLapper-ERR.log)
The above comment pointed to the general log-file, which is not usuful for debugging.
The one needed is found in "bin\default\logs" and also ends with ERR.log (like this: 127.0.0.1-29999-ERR.log)

Another way of checking if the PlayerVar has a value, is dumping the output to the Lapper console using this: writeline ( "DEBUG: " . GetCurrentPlayerVar( "PosAbs" ) );
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
If I remember well, you can configure your unitspeed within Lapper.
Let me quickly search if I can find how to do that.

*edit*
Found it: Now Player can do the choice of display Speed Unit in config screen ( Shift + i )
Yisc[NL]
S3 licensed
Syntax for ToMph is: ToMph( value )

So I think that this should work: $Speed_1 = ToMph( GetCurrentPlayerVar("InstantSpeed") );
Yisc[NL]
S3 licensed
Quote from kristofferandersen :Thanks for this. I did some searching around and it seems like SQLite is serverless, it doesn't have a server/process running all the time. Its a file that the coded program/website reads/make changes to.

Could someone confirm that this is true? If yes, that's amazing.
If this article is right, then I'm gonna give SQLite a try with my C# apps. Would definitely save me some time.

I can confirm that this is true.
See their website: https://www.sqlite.org/index.html
FGED GREDG RDFGDR GSFDG